
#pragma once
//#include "ChildView.h"
#include "SceneView.h"
#include "PropertiesWnd.h"
/*#include "AddEntityWnd.h"*/
 class CChildView;
/* class CAddEntityWnd;*/
extern float BrushValueTable[25];


class CMainFrame : public CFrameWndEx
{
	
public:
	CMainFrame();
protected: 
	DECLARE_DYNAMIC(CMainFrame)

// Attributes
public:

// Operations
public:

// Overrides
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);

// Implementation
public:
	 CChildView   * getChildView();
	// CAddEntityWnd *getCAddEntityWnd();// getCAddEntityWnd();

    CSceneView     m_wndSceneView;
    CPropertiesWnd m_wndProperties;
	
//	ManagerCDockablePane m_ManagerCDockablePane;
	//AddParticleWnd m_AddParticleWnd;
	CMFCRibbonStatusBar  m_wndStatusBar;
	
	virtual ~CMainFrame();
	const Apo::String GetTTextureName(unsigned int id) {if(id < m_TTextureNames.size()) return m_TTextureNames[id].c_str(); else return "";};
	void UpdateStatusBarPane(int nID, CString strText);
	void SetCameraPositions();
	void SetActiveCategory(int idx);
	//void UpdateTerrainOptions(Ogitors::CTerrainEditor *terrain);

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:  // control bar embedded members
	CMFCRibbonApplicationButton m_MainButton;
	CMFCRibbonBar       m_wndRibbonBar;
	CMFCRibbonGallery  *m_BrushGallery;
    CMFCRibbonGallery  *m_TTextureGallery;
	CMFCRibbonCategory *m_CatHome;
    CMFCRibbonCategory *m_CatETL;
	CMFCRibbonCategory *m_CatMusic;
	CMFCToolBarImages   m_PanelImages;
	CMFCToolBarImages   m_BrushImages;
	CMFCToolBarImages   m_TextureImages;
	CMFCRibbonLabel    *m_BrushSizeLabel; 
	//music
 
	CMFCRibbonLabel    *  m_MusicSizeLabel; 
	CMFCRibbonSlider    * m_MusicLabel; 
 

	CMFCRibbonLabel    *m_BrushIntensityLabel;


	CMFCRibbonStatusBarPane *m_FPSLabel;
	StringVector  m_BrushFiles;
    StringVector  m_TerrainTextureFiles;
	StringVector  m_BrushNames;
    StringVector  m_TTextureNames;
	CMFCRibbonButton   *m_CamBtn;
	
	CList<COLORREF,COLORREF> m_lstMainColors;
	CList<COLORREF,COLORREF> m_lstAdditionalColors;
	CList<COLORREF,COLORREF> m_lstStandardColors;

// Generated message map functions
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnClose();
	afx_msg void OnSetFocus(CWnd *pOldWnd);
	afx_msg void OnSizing(UINT nSide,LPRECT lpRect);
	afx_msg void OnApplicationLook(UINT id);
	afx_msg void OnUpdateApplicationLook(CCmdUI* pCmdUI);
	afx_msg void OnToolChange(UINT id);
	afx_msg void OnUpdateToolChange(CCmdUI* pCmdUI);
	afx_msg void OnUpdateViewMenu(CCmdUI* pCmdUI);
	afx_msg void OnAddObject(UINT id);
	afx_msg void OnUpdateAddObject(CCmdUI* pCmdUI);
	afx_msg void OnAxisChange(UINT id);
	afx_msg void OnUpdateAxisChange(CCmdUI* pCmdUI);
	afx_msg void OnFPSCombo();
	afx_msg void OnUpdateFPSCombo(CCmdUI* pCmdUI);
	afx_msg void OnOptionsDlg();
	afx_msg void OnUpdateOptionsDlg(CCmdUI* pCmdUI);
	afx_msg void OnFileNew();
	afx_msg void OnUpdateFileNew(CCmdUI* pCmdUI);
	afx_msg void OnFileOpen();
	afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI);
	afx_msg void OnFileSave();
	afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
	afx_msg void OnFileSaveAs();
	afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI);
	afx_msg void OnFileClose();
	afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI);
	afx_msg void OnViewTab(UINT id);
	afx_msg void OnUpdateViewTab(CCmdUI *pCmdUI);
	afx_msg void OnUserDefinedProperty(UINT id);
	afx_msg void OnUpdateUserDefinedProperty(CCmdUI *pCmdUI);
    afx_msg void OnETLBrushChange();
    afx_msg void OnETLTextureChange();
	afx_msg void OnETLColorChange();
	afx_msg void OnETLBrushOptionChange(UINT id);
	afx_msg void OnETLReLight();
	afx_msg void OnUpdateETLBrushOptions(CCmdUI *pCmdUI);
	afx_msg void OnCameraOptions(UINT id);
	afx_msg void OnCameraDelete(UINT id);
	afx_msg void OnUpdateCameraOptions(CCmdUI *pCmdUI);
	afx_msg void OnImportPlugins(UINT id);
	afx_msg void OnUpdateImportPlugins(CCmdUI *pCmdUI);
	afx_msg void OnExportPlugins(UINT id);
	afx_msg void OnUpdateExportPlugins(CCmdUI *pCmdUI);
	afx_msg void OnCustomGUI(UINT id);
	afx_msg void OnUpdateCustomGUI(CCmdUI *pCmdUI);
	//afx_msg void OnUpdateMusicGUI(CCmdUI *pCmdUI);
	afx_msg void OnEditorHotKey(UINT id);
	afx_msg void OnHelp( );
	afx_msg void OnUndoRedo(UINT id);
	afx_msg void OnUpdateUndoRedo(CCmdUI *pCmdUI);
    afx_msg void OnMusicGUI(UINT id);
	afx_msg void OnTimer(UINT nIDEvent);


	DECLARE_MESSAGE_MAP()

	void SaveCamPos();
	void CreateCameraMenu();
	void DeleteCamPos(int Index);
	void InitializeRibbon();
	BOOL CreateDockingWindows();
	void SetDockingWindowIcons(BOOL bHiColorIcons);
	void CreateDocumentColors();
	void CreateHomeCategory();
	void CreateETLToolsCategory();

	void CreateMusicToolsCategory();

    void CreateCustomCategories();
	void CreateImageCaches();
    void CreateToolbarImageList(StringVector imglist16, StringVector imglist32);

	COLORREF GetColorFromColorButton(int nButtonID);
	int  GetSliderState(int nButtonID);
	void CreateNewProjectOptions();
	void CreateNewSceneFile();
     void AddItemToToolbar(CMFCRibbonPanel *panel, Apo::OGUIWidget *item, bool subtoolbar);
     void AddItemToButton(CMFCRibbonButton *parent, Apo::OGUIWidget *item);
};


